package com.pda.gongpin.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.pda.gongpin.R;
import com.pda.gongpin.bean.DropDownByEntryNoBean;
import com.pda.gongpin.bean.RawMaterialTypeBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;


import java.util.List;

public class SelectRawAdapter extends BaseAdapter<DropDownByEntryNoBean> {
    String id;
    public SelectRawAdapter(int layoutResId, @Nullable List<DropDownByEntryNoBean> data,String id) {
        super(layoutResId, data);
        this.id=id;
    }

    @Override
    protected void convert(BaseViewHolder helper, DropDownByEntryNoBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_title,item.getShowStr());
        if (id.equals(item.getEntryNumberId())){
            helper.itemView.setBackgroundColor(getContext().getResources().getColor(R.color._FF5D5D));
        }else {
            helper.itemView.setBackgroundColor(getContext().getResources().getColor(R.color.white));
        }
    }
}
